On-board network system

ABSTRACT

There is provided a new on-board network system having a relay device that relays communication frames between on-board networks, and, between an on-board network and an external device, such as being capable of supporting communication between an on-board network and an external device without a storage area of a relay device being increased.

CROSS-REFERENCE TO RELATED APPLICATION

This application is based on and claims the benefit of priority fromearlier Japanese Patent Application No. 2012-187555 filed Aug. 28, 2012,the description of which is incorporated herein by reference.

BACKGROUND OF THE INVENTION

1. Technical Field

The present invention relates to an on-board network system having arelay device that relays communication frames between on-board networks,and between an on-board network and an external device.

2. Description of the Related Art

Conventionally, numerous electronic control units (ECUs) are mounted ina vehicle to control on-board devices. A plurality of on-board networksare constructed by each ECU being disposed on any of a plurality ofcommunication buses. A relay device is connected to the plurality ofcommunication buses to enable the ECUs to transmit and receivecommunication frames even between on-board networks.

In addition, in general, the communication frame includes a message anda message identifier. The message indicates various detection valuesindicating the state of the vehicle, commands issued to another ECU, andthe like. The message identifier is used to identify the type ofmessage. Each ECU judges whether or not to receive a message based onthe message identifier in the communication frame.

In a configuration such as this, the relay device has a plurality ofcommunication ports for transmitting and receiving communication frames.The relay device also stores therein a routing table in which themessage identifier is associated with a port identifier (identifier foridentifying the communication port that is the output destination of thecommunication frame). The relay device determines the communication portthat is the output destination based on the message identifier in thecommunication frame (refer, for example, to JP-A-2008-99014).

When an ECU diagnosis is performed, an external device, such as afailure diagnosis device, provided in a repair shop or the like is used.This type of failure diagnosis device is ordinarily connected by wire toa connector (and ultimately the communication port) provided in avehicle in the repair shop or the like. As a result, the failurediagnosis device is able to communicate with the ECUs via the relaydevice. The failure diagnosis device acquires various pieces ofinformation from the ECUs and updates data within the ECUs.

However, in the conventional configuration, when relaying communicationframes between the external device such as that described above and anon-board network, the relay device uses the routing table. Therefore, asshown in FIG. 1 for example, a message identifier and a port identifierare required to be stored for each type of message sent as a requestfrom the failure diagnosis device to the ECU. A message identifier and aport identifier are also required to be stored for each type of messagesent in response from the ECU to the failure diagnosis device.

Therefore, an enormous amount of content is stored in the routing table.A problem occurs in that the amount of content cannot be supportedwithout the memory area of the relay device being increased. Inaddition, for example, the storage area of the relay device is requiredto be further increased and the routing table is required to be updated,not only for pre-existing external devices such as the failure diagnosisdevice, but also every time a new external device capable ofcommunicating with the ECUs via the relay device is installed.

Therefore, a network system is desired that is capable of supportingcommunication between an on-board network and an external device withouta storage area of a relay device being increased.

SUMMARY

As an exemplary embodiment, the present application provides a networksystem having a relay device that relays communication frames betweenon-board networks, and between an on-board network and an externaldevice. In the network system, the communication frames are comprised ofat least: a first communication frame that is transmitted and receivedwithin an on-board network and also between the on-board network and therelay device; and a second communication frame transmitted from theexternal device to the relay device. The first communication frameincludes at least: a first message that is received by an electroniccontrol unit configuring the on-board network or the external device;and a first message identifier defined advance for identifying the firstmessage. The second communication frame includes at least: a secondmessage received by the electronic control unit; and a second messageidentifier defined in advance for identifying the second message.

The relay device has a plurality of communication ports for transmittingand receiving the first communication frame and the second communicationframe. The relay device also stores therein a routing table in which thefirst message identifier related to the first communication frame isassociated with a port identifier for identifying a communication portthat is an output destination of the first communication frame.

On the other hand, transmission of the second communication frame fromthe external device to the relay device is done by at least adding theport identifier of the on-board network to which the secondcommunication frame is to be sent, as a header, to the second messageidentifier included in the second communication frame.

As a result of a configuration such as this, the communication frametransmitted from the external device includes information (portidentifier) identifying the communication port that is the outputdestination of the communication frame. Therefore, the relay device isable to transfer the communication frame to the on-board network inadherence to the port identifier.

Therefore, according to the exemplary embodiment, a message identifierand a port identifier are not required to be stored in a routing tablefor each type of message transmitted from an external device to anon-board network. Furthermore, communication performed between anon-board network and an external device can be favorably supportedwithout a storage area of a relay device being increased.

BRIEF DESCRIPTION OF THE DRAWINGS

In the accompanying drawings:

FIG. 1 shows a diagram of overloading of a storage area in a prior art;

FIG. 2 shows a block diagram of an overview of a network systemaccording to an embodiment;

FIG. 3 shows a diagram of a configuration of a first communication frameaccording to the embodiment;

FIG. 4 shows a diagram of a configuration of a second communicationframe according to the embodiment;

FIG. 5 shows a block diagram of a configuration of a relay deviceaccording to the embodiment;

FIG. 6 shows a flowchart of the processing operations of a second relayprocess performed by the relay device;

FIG. 7 shows a flowchart of the processing operations of relay necessityjudgment performed by the relay device;

FIG. 8 shows a first diagram of exemplary operations by the networksystem according to the embodiment;

FIG. 9 shows a second diagram of exemplary operations by the networksystem according to the embodiment; and

FIG. 10 shows a third diagram of exemplary operations by the networksystem according to the embodiment.

DETAILED DESCRIPTION OF THE PREFERRED EMBODIMENTS

An embodiment of the present invention will hereinafter be describedwith reference to the drawings.

<Overall Configuration>

FIG. 2 is a block diagram of an overview of the network system.

As shown in FIG. 2, a network system 1 includes a first on-board localarea network (LAN) 11, a second on-board LAN 12, a third on-board LAN13, a failure diagnosis device (referred to, hereinafter, as a“diagnostic tester”) 100, and a relay device 101. The first on-board LAN11 is an on-board network composed of a plurality of ECUs 102, . . .each connected to a communication line (referred to, hereinafter, as a“communication bus”) 111 that is in a bus state. The second LAN 12 is anon-board network composed of a plurality of ECUs 103, . . . connected toa communication bus 112. The third LAN 13 is an on-board networkcomposed of a plurality of ECUs 104, . . . connected to a communicationbus 113. The diagnostic tester 100 is connected to a communication bus110 as an external device. The relay device 101 connects the firston-board LAN 11, the second on-board LAN 12, the third on-board LAN 13,and the diagnostic tester 100 to each other.

The relay device 101 is an ECU that relays communication frames(sometimes referred to, hereinafter, as simply “frames”) transmitted andreceived among the first on-board LAN 11, the second on-board LAN 12,and the third on-board LAN 13, and between the first on-board LAN 11,the second on-board LAN 12, the third on-board LAN 13, and thediagnostic tester 100. The relay device 101 has a plurality ofcommunication ports (referred to, hereinafter, as “ports”) 120 to 123that are each used to transmit and receive communication frames betweenthe first on-board. LAN 11, the second on-board LAN 12, the thirdon-board LAN 13, and the diagnostic tester 100. Specifically, the relaydevice 101 has the port 121 connected to the communication bus 111, theport 122 connected to the communication bus 112, the port 123 connectedto the communication bus 113, and the port 120 connected to thecommunication bus 110.

The diagnostic tester 100 is provided at a car dealership a repair shop,a gas station, and the like and diagnoses the ECUs 102, 103, 104 . . . .Specifically, the diagnostic tester 100 is connected to thecommunication bus 110 via a connector (not shown) provided in thevehicle. The diagnostic tester 100 acquires various pieces ofinformation from the ECUs 102, 103, 104 . . . via the relay device 101,and updates the data within the ECUs 102, 103, 104 . . . .

The data communication performed within the first on-board LAN 11, thesecond on-board LAN 12, and the third on-board LAN 13, and among thefirst on-board LAN 11, the second on-board LAN 12, the third on-boardLAN 13 via the relay device 101 uses, for example controller areanetwork (CAN) protocol commonly used in on-board LANs.

<Configuration of Communication Frame>

A communication frame (referred to, hereinafter, as a “firstcommunication frame”) 1A used in the first on-board LAN 11, the secondon-board LAN 12, and the third on-board LAN 13 is composed of astart-of-frame, an arbitration field, a control field, a data field, aCRC field, an ACK field, and an end-of-frame. The start-of-frameindicates the start of the frame. The arbitration frame indicates thepriority level of the frame and the like. The control field indicatesthe number of bytes of the data and the like. The data field is thesubstantive data to be transferred. The CRC field adds a CRC forchecking for any frame error. The ACK field receives a notification(ACK) from a unit that has received a correct message. The end-of-frameindicates the end of the frame. The first communication frame 1A is wellknown in CAN protocol.

FIG. 3 illustrates a diagram in which an 11-bit or 29-bit arbitrationfield (referred to, hereinafter as an “ID area”) and a 0- to 64-bit datafield (referred to, hereinafter, as a “DT area”) required for thefollowing description have been extracted from a first communicationframe 21.

As shown in FIG. 3, a message 23 is written in the DT area. The message23 indicates various detection values indicating the state of thevehicle, diagnosis result of a self-diagnosis process, describedhereafter, commands issued to other ECUs 102, 103, 104 . . . , and thelike. In addition, a priority identifier 24 and a message identifier 25are set in the ID area. The priority identifier 24 is used to indicatethe priority level of the message 23. The message identifier 25 is usedto identify the kind of message 23 assigned to the frame (in otherwords, the type of frame).

Transmission destination information 26 and transmission source ECUinformation 27 a are set as required in the message identifier 25. Thetransmission destination information 26 indicates the transmissiondestination (ECU 102, 103, 104 . . . or the diagnostic tester 100) ofthe message 23. The transmission source ECU information 27 a is used toidentify the ECU 102, 103, 104 . . . that is the transmission source ofthe message 23.

Furthermore, within the transmission destination information 26,transmission destination ECU information 26 a is used to identify theECU 102, 103, 104 . . . that is the transmission destination of themessage 23. The transmission destination ECU information 26 a and thetransmission source ECU information 27 a include common bits (not shown)that are common among a plurality of ECUs (at least two ECUs among theECUs 102, 103, 104 . . . ) that have been grouped in advance.

For example, in an instance in which the ECU 102 and the ECU 103 aregrouped and the common bits defined in advance are the two bits “11”,the transmission destination ECU information 26 a and the transmissionsource ECU information 27 a corresponding to the ECU 102 and the ECU 103are respectively expressed as “1100001” and “1100010” in which thecommon bits are the two high-order bits. In addition, in an instance inwhich the ECU 104 does not belong to the above-described group, thetransmission destination ECU information 26 a and the transmissionsource ECU information 27 a corresponding to the ECU 104 are expressed,for example, as “0000011”, “0100011”, or “1000011”. In this way, in thetransmission destination ECU information 26 a and the transmissionsource ECU information 27 a, the two high-order bits are defined as thecommon bits, and the remaining five bits are defined as identificationbits for the ECU 102, 103, 104, . . . .

Next, a communication frame (referred to, hereinafter, as a “secondcommunication frame”) 32 used for transmission from the diagnostictester 100 to the relay device 101 will be described. As shown in FIG.4, a service command 33 and a header section 34 are set in the secondcommunication frame 32.

The service command 33 is basically configured in a manner similar tothe first communication frame 21. A message (hereinafter referred to asa “request message”) 35 is set in the DT area. The request message 35indicates a request made to the ECU 102, 103, 104, . . . to perform theself-diagnosis process, described hereafter. The priority identifier 24and a message identifier 36 for identifying the request message 35 areset in the ID area.

In addition, transmission destination ECU information 36 a andtransmission source tester information 37 a are set in the messageidentifier 36. The transmission destination ECU information 36 a is usedto identify the ECU 102, 103, 104 . . . that is the transmissiondestination of the request message 35. The transmission source testerinformation 37 a is used to identify the diagnostic tester 100 that isthe transmission source of the request message 35.

On the other hand, a port identifier 38, mask information 39, thetransmission source tester information 37 a, and the transmissiondestination ECU information 36 a are set in the header section 34. Theport identifier 38 is used to identify the port 121 to 123 that is theoutput destination of the frame. The mask information 39 is used toidentify the above-described common bits.

For example, as shown in FIG. 4, in an instance in which thetransmission destination of the service command 33 is a single ECU (oneECU among the ECUs 102, 103, 104 . . . ), an identifier 00-FE isassigned as the port identifier 38. The identifier 00-FE indicates theport (one port among the ports 121, 122, and 123) corresponding to thecommunication bus (one communication bus among the communication buses111, 112, and 113) to which the ECU is connected. The mask information39 is set to an invalid value indicating that common bits are notspecified. The transmission destination ECU information 36 a is set toseven bits of data, such as “1100001”.

In addition, in an instance in which the transmission destination of theservice command 33 is a plurality of ECUs connected to a certaincommunication bus (at least one communication bus among thecommunication buses 111, 112, and 113), an identifier 00-FE is assignedas the port identifier 38. The identifier 00-FE indicates the port (atleast one port among the ports 121, 122, and 123) corresponding to thecommunication bus. The mask information 39 is set, as required, to avalid value indicating that common bits are identified. The transmissiondestination ECU information 36 a is set to two bits of data (commonbits), such as “11”, or 7×N bits of data (N being an integer of 2 ormore) depending on the number of ECUs.

In an instance in which the transmission destination of the servicecommand 33 is ECUs connected to all communication buses 111, 112, and113, the port identifier 38 is set to an identifier FF that indicatesall ports 121, 122, and 123.

<ECU>

The ECUs 102, 103, 104. . . all basically have a similar configuration.Each ECU 102, 103, 104. . . includes a communication circuit and amicrocomputer. The communication circuit is composed of a transceiverand a CAN controller. The transceiver sends data to the communicationbus 111, 112, 113 . . . to which the ECU is connected and takes in datafrom the communication bus 111, 112, 113 . . . . The CAN controllercontrols communication via the on-board LAN 11, 12, 13 configured by theECU in adherence to the known CAN protocol. The microcomputer is mainlyconfigured by a central processing unit (CPU), a read-only memory (ROM),a random access memory (RAM), and an input/output (I/O). Themicrocomputer controls the CAN controller and communicates with otherECUs, thereby operating in cooperation with other ECUs and runningvarious processes to actualize the function assigned to its own ECU. Thehardware configuration of the ECU is well known and is therefore omittedfrom the drawings in the present specification.

Each ECU 102, 103, 104 . . . is assigned a transmission ID and areception ID as the message identifier 25. The transmission ID is fortransmitting the message 23 to other ECUs 102, 103, 104 . . . . Thereception ID is for messages that the ECU itself should receive. Inaddition, each ECU 102, 103, 104 . . . is assigned an own ID and otherID. The own ID is for identifying the ECU itself. The other ID is forindentifying other ECUs 102, 103, 104 . . . and the diagnostic tester100. The own ID is used as the transmission source ECU information 27 aand the transmission destination ECU information 26 a and 36 a. Theother ID is used as the transmission source ECU information 27 a, thetransmission source tester information 37 a, and the transmissiondestination information 26.

When a communication frame is transmitted, the microcomputer generatesthe DT area that is the main body of the message and supplies the DTarea to the communication circuit. The microcomputer also performsvarious processes in adherence to the content of the DT area suppliedfrom the communication circuit. In particular, when the receivedcommunication frame is the service command 33, the microcomputerperforms the self-diagnosis process for diagnosing failure related toon-board devices controlled by the microcomputer itself, whether or notan error related to its own various processes has occurred, and thelike. The microcomputer then generates a DT area in which a responsemessage (message 23) indicating the self-diagnosis results is written.

The communication circuit places the DT area supplied from themicrocomputer in a communication frame to which the transmission ID hasbeen added. In addition, the communication circuit receives acommunication frame to which the reception ID has been added andsupplies the DT area to the microcomputer. In particular, regarding theDT area in which the response message (message 23) is written, thecommunication circuit places the DT area in a communication frame towhich a transmission ID has been added, the transmission ID includingthe message identifier 25 in which the other ID indicating thediagnostic tester 100 is set as the transmission destination information26 and the own ID is set as the transmission source ECU information 27a. In addition, the communication circuit receives a communication frameto which a reception ID has been added, the reception ID in which theown ID is included in the message identifiers 25 and 36 as thetransmission destination ECU information 26 a and 36 a. Thecommunication circuit then supplies the DT area of the receivedcommunication frame to the microcomputer.

<Relay Device>

As shown in FIG. 5, the relay device 101 includes communication circuits40, 41, 42, and 43, and a microcomputer 50 that are basically configuredin a manner similar to the communication circuit and microcomputerconfiguring the ECU 102, 103, 104, . . . . The relay device 101 alsoincludes a non-volatile memory 60 that stores therein a routing table,described hereafter. The communication circuit 40 is connected to thecommunication bus 110 via the port 120. The communication circuits 41,42, and 43 are respectively connected to the communication buses 111,112, and 113 via the ports 121, 122, and 123.

Among the communication circuits 41, 42, and 43, the communicationcircuit 41 is assigned an ID code (relay ID) of a communication framethat is transmitted from the ECU 102, . . . connected to the firston-board LAN 11 and is required to be relayed to the second on-board LAN12, the third on-board LAN 13, or the diagnostic tester 100. Thecommunication circuit 42 is assigned an ID code (relay ID) of acommunication frame that is transmitted from the ECU 103, . . .connected to the second on-board LAN 12 and is required to be relayed tothe first on-board LAN 11, the third on-board LAN 13, or the diagnostictester 100. The communication circuit 43 is assigned an ID code (relayID) of a communication frame that is transmitted from the ECU 104, . . .connected to the third on-board LAN 13 and is required to be relayed tothe first on-board LAN 11, the second on-board LAN 12, or the diagnostictester 100. The communication circuits 41, 42, and 43 are each set suchas to take in a communication frame having a transmission ID identicalto the relay ID assigned to the communication circuit 41, 42, or 43 as afirst relay frame. The communication circuits 41, 42, and 43 are alsoeach set such as to take in a communication frame having the messageidentifier 25 including at least the transmission destinationinformation 26 in which the diagnostic tester 100 is the transmissiondestination as a second relay frame.

The non-volatile memory 60 stores therein a routing table in which eachrelay ID is associated with the port identifier for identifying the port121, 122, or 123 that is the output destination of the communicationframe having the transmission ID identical to the relay ID.

The microcomputer 50 performs a first relay process in which the portidentifier corresponding with the relay ID of the first relay frametaken in by the communication circuits 41, 42, and 43 is extracted fromthe routing table. The first relay frame is then transferred from theport (at least one port among the ports 121, 122, and 123) indicated bythe extracted port identifier, via the communication circuit 41, 42, or43.

On the other hand, the communication circuit 40 is set to receive acommunication frame (second communication frame 32) having the headersection 34. The microcomputer 50 performs a second relay process forrelaying the communication frames transmitted and received between thediagnostic tester 100 and the ECUs 102, 103, 104 . . . .

The microcomputer 50 is a known microcomputer mainly configured by a CPU51, a ROM 52, a RAM 53, and an I/O (Input/Output) 54. In thisconfiguration, the CPU 51 is configured to perform the first relayprocess and the second relay process using the RAM 53 as a work buffer,based on a program stored in the ROM 52 or the non-volatile memory 60.

In addition, the microcomputer 50 has a timer 55 that clocks a sessionperiod after a second communication frame transmitted from thediagnostic tester 100 is received, every time the second communicationframe is received. The session period is prescribed in advance as theamount of time required for the second relay process.

<Second Relay Process>

Here, the processing operations of the second relay process performed bythe CPU 51 of the relay device 101 will be described with reference to,the flowchart in FIG. 6. The processing operations performed by thediagnostic tester 100 and the ECU (102, 103, 104, . . . ) related to thesecond relay process are indicated surrounded by dotted lines in FIG. 6.Because these processing operations are not performed by the CPU 51 ofthe relay device 101, they are described without the use of stepnumbers.

The second relay process is started when, for example, the diagnostictester 100 is connected to the communication bus 110 via a connector(not shown) provided in the vehicle. When the second relay process isstarted, at step S210, the CPU 51 judges whether or not the secondcommunication frame transmitted from the diagnostic tester 100 isreceived via the communication circuit 40. When judged that the secondcommunication frame is received, the CPU 51 proceeds to step S220.

At step S220, the CPU 51 extracts the header section 34 (the portidentifier 38, the mask information 39, the transmission source testerinformation 37 a, and the transmission destination ECU information 36 a)from the second communication frame received at step S210 and stores theextracted header section 34 in a predetermined area (referred tohereinafter as a “buffer”) 56 of the RAM 53.

At subsequent step S230, the CPU 51 extracts the service command 33 (themessage identifier 36 and the request message 35) from the secondcommunication frame received at step S210 and transmits the extractedservice command 33 from the port (at least one port among the ports 121,122, and 123) indicated by the port identifier 38 extracted at stepS220, via the corresponding communication circuit (at least onecommunication circuit among the communication circuits 41, 42, and 43).As described above, the service command 33 has a configuration similarto that of the first communication frame 21. In addition, the messageidentifier 36 of the service command 33 includes the transmissiondestination ECU information 36 a and the transmission source testerinformation 37 a as described above. The processing operations at stepS220 and step S230 are performed every time the second communicationframe is received, regardless of subsequent processing operations.

Hereafter, the ECU (at least one ECU among the ECUs 102, 103, 104 . . .) that has received the service command 33 performs the self-diagnosisprocess in adherence to the request message in the service command 33.The ECU then transmits the first communication frame 21 to the relaydevice 101. In the first communication frame 21, a response message(message 23) indicating the self-diagnosis results is added to themessage identifier 25. Here, the message identifier 25 includes thetransmission destination information 26 for identifying the diagnostictester 100 and the transmission source ECU information 27 a, asdescribed above.

Then, at subsequent step S240, the CPU 51 judges whether or not thefirst communication frame 21 including the transmission destinationinformation 26 for identifying the diagnostic tester 100 is received viathe communication circuit (at least one communication circuit among thecommunication circuits 41, 42, and 43). Each time the CPU 51 judges thatthe first communication frame is received, The CPU 51 performs relaynecessity judgment (step S250) and subsequent processing operationsevery tome the first communication frame 21 is judged to be received.

Here, as shown in the flow chart in FIG. 7, in the relay necessityjudgment performed at step S250, first, the CPU 51 judges whether or notthe header section 34 including the port identifier 38 corresponding tothe port (one port among the ports 121, 122, and 123) in which the firstcommunication frame. 21 received at step S240 has been inputted isstored in the buffer 56 (step S410). When judged “YES” at step S410, theCPU 51 proceeds to step S420. When judged “NO” at step S410, the CPU 51eliminates (deletes) the first communication frame 21 received at stepS240 and proceeds to step S470.

At step S420, the CPU 51 judges whether or not, among the at least oneheader section 34 applicable at step S410, the header section 34 ispresent that includes the transmission source tester information 37 aidentical to the transmission destination information 26 of the firstcommunication frame 21 received at step S240. When judged “YES” at stepS420, the CPU 51 proceeds to step S430. When judged “NO” at step S420,the CPU 51 eliminates (deletes) the first communication frame 21received at step S240 and proceeds to step S470.

At step S430, the CPU 51 judges whether or not, among the at least oneheader section 34 applicable at S420, the header section 34 is presentin which the mask information 39 is set to a valid value. When judged“YES” at step S430, the CPU 51 proceeds to step S440. When judged “NO”at step S430, the CPU 51 proceeds to step S450.

At step S440, the CPU 51 judges whether or not the two high-order bitsof the transmission destination ECU information 36 a identical to thecommon bits in the transmission source ECU information 27 a of the firstcommunication frame 21 received at step S240, based on the maskinformation 39 and the transmission destination ECU information 36 a inthe header section 34 applicable at step S430. When judged “YES” at stepS440, the CPU 51 proceeds to step S460. When judged “NO” at step S440,the CPU 51 proceeds to step S450.

At step S450, the CPU 51 judges whether or not, among the at least oneheader section 34 applicable at step S430, the header section 34including the transmission destination ECU information 36 a identical tothe transmission source ECU information 27 a of the first communicationframe 21 received at step S240 is present. When judged “YES” at stepS450, the CPU 51 proceeds to step S460. When judged “NO” at step S450,the CPU 51 eliminates (deletes) the first communication frame 21received at step S240 and proceeds to step S470.

At step S460, the CPU 51 judges that the first communication frame 21received at step S240 is required to be relayed and proceeds to stepS270. On the other hand, at step S470, the CPU 51 judges that the firstcommunication frame 21 received at step S240 is not required to berelayed and proceeds to step S260. Returning to the flowchart in FIG. 6,at step S260 to which the CPU 51 proceeds, the CPU 51 returns to stepS210 without performing the processing operations at step S260 to stepS300, described hereafter.

On the other hand, at step S270, the CPU 51 transmits the firstcommunication frame 21 (including the response message, i.e. message 23)received at step S240 to the diagnostic tester 100 via the communicationbus 110 from the port 120 via the communication circuit 40. The CPU 51then proceeds to step S280. The diagnostic tester 100 that has receivedthe first communication frame 20 takes in the response message (message23) from the first communication frame 21.

At step S280, the CPU 51 judges whether or not the transmissiondestination of the service command 33 corresponding with the firstcommunication frame 21 transmitted at step S270 is a single ECU (one ECUamong the ECUs 102, 103, 104 . . . ) based on at least one of the maskinformation 39 and the transmission destination ECU information 36 a inthe header section 34 corresponding to the first communication frame 21transmitted at step S270. When judged “YES” at step S280, the CPU 51proceeds to step S300. When judged “NO” at step S280, the CPU 51proceeds to step S290.

At step S290, the CPU 51 judges whether or not the session period of thesecond relay process has elapsed based on the time clocked by the timer55. When judged “YES” at step S290, the CPU 51 proceeds to step S300.When judged “NO” at step S290, the CPU 51 proceeds to step S260. At stepS260 to which the CPU 51 has proceeded, the CPU 51 returns to step S210without performing the processing operation at step S300, describedhereafter.

Finally, at step S300, the CPU 51 deletes the header section 34corresponding with the first communication frame 21 transmitted at stepS270 from the buffer 56 and returns to step S210.

<Operations>

Next, operations performed by the network system 1 configured asdescribed above will be described.

First, as shown in FIG. 8, the second communication frame 32 istransmitted from the diagnostic tester 100 to the relay device 101 viathe port 120. When the relay device 101 receives the secondcommunication frame 32, the relay device 101 separates the headersection 34 and the service command 33 from the second communicationframe 32. The relay device 101 stores the header section 34 (the portidentifier 38, the mask information 39, the transmission source testerinformation 37 a, and the transmission destination ECU information 36 a)in the buffer 56.

Then, the relay device 101 sends the service command 33 from thecommunication port (at least one communication port among thecommunication ports 121, 122, and 123) indicated by the port identifier38 in the header section 34. When the ECU (at least one ECU among theECUs 102, 103, 104 . . . ) corresponding to the transmission destinationECU information 36 a in the service command 33 receives the servicecommand 33, the ECU performs the self-diagnosis process. The ECU thentransmits the first communication frame 21 including the responsemessage (message 23) indicating the self-diagnosis results, thetransmission destination information 26, and the transmission source ECUinformation to the relay device 101.

Here, as shown in FIG. 9, when the relay device 101 receives the firstcommunication frame 21, the relay device 101 judges whether or not themask information 39 in the header section 34 stored in the buffer 56indicates a valid value. When judged that the mask information 39indicates an invalid value, the relay device 101 judges that thetransmission destination of the service command 33 is a single ECU. Therelay device 101 replies to the diagnostic tester 100 with the receivedsingle communication frame 21 and eliminates (deletes) the headersection 34 from the buffer 56.

On the other hand, as shown in FIG. 10, when the mask information 39 inthe header section 34 stored in the buffer 56 indicates a valid value,the relay device 101 judges that the transmission destination of theservice command 33 is a plurality of ECUs. The relay device 101 repliesto the diagnostic tester 100 with the received single firstcommunication frame 21. The relay device 101 then replies to thediagnostic tester 100 with the first communication frame 21 every timethe first communication frame 21 is received during the wait perioduntil the session period has elapsed. When the session period haselapsed (timed out), the relay device 101 eliminates (deletes) therelayed information from the buffer 56.

<Effects>

As described above, in the network system 1, when the relay device 101relays a communication frame (first communication frame 21) among theon-board LANs 11, 12, and 13, the relay device 101 receives acommunication frame (second communication frame 32) from the diagnostictester 100, while using the routing table in a manner similar to that inthe conventional configuration. In the second communication frame 32,the header section 34 including the port identifier 38 is added to theservice command 33.

Therefore, the relay device 101 is capable of transmitting the requestmessage 35 to the ECU connected to a predetermined on-board LAN (atleast one on-board LAN among the on-board LANs 11, 12, and 13), withoutchanging the protocols of the on-board LANs 11, 12, and 13, bytransferring the service command 33 to the port (at least one port amongthe ports 121, 122, and 123) indicated by the port identifier 38included in the header section 34, because the service command 33 hasthe same configuration as the first communication frame 21.

Therefore, in the network system 1, the relay device 101 is not requiredto store, in the routing table, the message identifiers 36 and 26 andthe port identifiers 38 for the various request messages 35 and responsemessages (messages 23) transmitted and received between the diagnostictester 100 and the on-board LANs 11, 12, and 13. Furthermore, thestorage area of the non-volatile memory 60 can be conserved.

The message identifier 25 of the first communication frame 21 includesthe transmission destination information 26 indicating the transmissiondestination of the message 23. The message identifier 36 of the secondcommunication frame 32 includes the transmission destination ECUinformation 36 a indicating the transmission destination of the message35. Therefore, for example, the diagnostic tester 100 can, take inrequest messages 35 individually for the ECUs 102, 103, 104 . . . .

In addition, in the network system 1, the header section 34 stored inthe buffer 56 of the relay device 101 includes the transmission sourcetester information 37 a. Therefore, when the relay device 101 receivesthe first communication frame 21 including the response message (message23) in response to the request message 35, the relay device 101 caneliminate (delete) the header section 34 including the transfer sourcetester information 37 a in the buffer 56, based on the transmissiondestination information 26 of the first communication frame 21. As aresult, the response message (message 23) addressed to the diagnostictester 100 can be favorably relayed.

Furthermore, in the network system 1, the header section 34 stored inthe buffer 56 of the relay device 101 includes the transmissiondestination ECU information 36 a. Therefore, when the relay device 101receives the first communication frame 21 including the response message(message 23) in response to the request message 35, the relay device 101can eliminate (delete) the header section 34 including the transmissiondestination ECU information 36 a in the buffer 56, based on thetransmission source ECU information 27 a in the first communicationframe 21. As a result, the response message (message 23) from the ECU(at least one ECU among the ECUs 102, 103, 104 . . . ) designated by thediagnostic tester 100, among the response messages (messages 23)addressed to the diagnostic tester 100, can be favorably relayed.

In addition, in the network system 1, when the mask information 39indicates a valid value in the header section 34 stored in the buffer 56of the relay device 101, when the relay device 101 receives the firstcommunication frame 21 including the response message (message 23) inresponse to the request message 35, the relay device 101 references thetwo high-order bits (common bits) of the transmission source ECUinformation 27 a of the first communication frame 21 and judges whetheror not the response message (message 23) is that from the ECU (at leastone ECU among the ECUs 102, 103, 104. . . ) designated by the diagnostictester 100. Therefore, the relay device 101 is not required to referenceall bits of the transmission source ECU information 27 a, therebyreducing the processing load on the relay device 101.

[Other Embodiments]

An embodiment of the present invention is described above. However, thepresent invention is not limited to the above-described embodiment.Various embodiments are possible without departing from the scope of thepresent invention.

For example, in the relay necessity judgment according to theabove-described embodiment, the mask information 39 and the transmissiondestination ECU information 36 a in the header section 34 are used.However, at least the transmission source tester information 37 a may beused. In other words, in this instance, the header section 34 is notnecessarily required to include the mask information 39 and thetransmission destination ECU information 36 a, and is merely required toinclude at least the port identifier 38 and the transmission sourcetester information 37 a.

In addition, the network system 1 according to the above-describedembodiment is described under a premise that the relay device 101replies to the diagnostic tester 100 with the first communication frame21 including the response message (message 23) in response to therequest message 35. However, the present invention is not limitedthereto. A configuration is possible in which the diagnostic tester 100merely transmits the service command 33 to the ECU connected to apredetermined on-board LAN (at least one on-board LAN among the on-boardLANs. 11, 12, and 13). In this instance, the header 34 is notnecessarily required to include the transmission source testerinformation 37 a, and is merely required to include at least the portidentifier 38.

What is claimed is:
 1. An on-board network system having a relay devicethat relays communication frames between on-board networks, and betweenan on-board network and an external device, wherein the communicationframes are at least composed of a first communication frame that istransmitted and received within an on-board network and between theon-board network and the relay device, and a second communication frametransmitted from the external device to the relay device; the firstcommunication frame includes at least a first message that is receivedby an electronic control unit configuring the on-board network or theextern& device and a first message identifier defined in advance foridentifying the first message; the second communication frame includesat least a second message received by the electronic control unit and asecond message identifier defined in advance for identifying the secondmessage; the relay device has a plurality of communication ports fortransmitting and receiving the first communication frame and the secondcommunication frame, and also stores therein a routing table in whichthe first message identifier related to the first communication frame isassociated with a port identifier for identifying a communication portthat is an output destination of the first communication frame; andtransmission of the second communication frame from the external deviceto the relay device is done by at least adding the port identifier ofthe on-board network to which the second communication frame is to besent, as a header, to the second message identifier included in thesecond communication frame.
 2. The on-board network system according toclaim 1, wherein the first message identifier of the first communicationframe includes transmission destination information indicating thedestination of the first message of the first communication frame; andthe second message identifier of the second communication frame includesother transmission destination information indicating the destination ofthe second message of the second communication frame.
 3. The on-boardnetwork system according to claim 2, wherein transmission of the secondcommunication frame from the external device to the relay device is doneby previously adding both transmission source information of the messageand the port identifier of the on-board network to which the secondcommunication frame is to be sent, as a header, to the second messageidentifier included in the second communication frame; the relay device,when it receives the second communication frame from the externaldevice, stores the header of the second communication frame in an ownbuffer, and outputs both the second message identifier of the secondcommunication frame and the second message, as the first communicationframe, to a communication port of the on-board network, designated bythe port identifier; and when it receives the first communication frameresponded from a communication port that is designated by the portidentifier included in the header stored in the buffer, under acondition that a transmission source information indicated by the portidentifier included in the header is identical to a transmissiondestination information included in the first message identifier of thefirst communication frame received, transmits the received firstcommunication frame to the external device and then eliminates theheader from the buffer.
 4. The on-board network system according toclaim 3, wherein the message identifier of the first communication frameincludes a transmission source ECU information for identifying theelectronic control unit indicating a transmission source of the message;the header includes a transmission destination ECU information foridentifying an electronic control device indicating a transmissiondestination source of the message; and the relay device, when itreceives the first communication frame from the communication port thatis indicated by the port identifier included in the header that isstored in the buffer, under a condition that the transmissiondestination ECU information being indicated by the port identifierincluded in the header is not identical to the transmission source ECUinformation included in the message identifier of the firstcommunication frame, prohibits both the transmission of the firstcommunication frame to the external device and elimination of the headerfrom the buffer.
 5. The on-board network system according to claim 4,wherein the transmission source ECU information and the transmissiondestination ECU information respectively includes common bits that arecommon among a plurality of the electronic units that have been groupedin advance; the header includes a mask information for identifying thecommon bits; and the relay device, when it receives the firstcommunication frame from the communication port being indicated by theport identifier included in the header that is stored in the buffer,under a condition that the common bits specified by the mask informationindicated by the port identifier that is included in the header isidentical to the common bits included in the message identifier of thefirst communication frame, performs both transmission of the respondedfirst communication frame to the external device and elimination of theheader from the buffer.